<?php 
namespace app\superadmin\controller;
use think\Db;
use think\Controller;
class Information extends Base{
	public function index(){
		$infos=Db::name('information')->alias('i')->join('admins a','i.adminid=a.adminid')->join('users u','i.uid=u.uid')->paginate(10);
		//序号自增
		$page=request()->param('page');
		$page||($page=1);
		$this->assign('page',$page);
		// $infos+=['j'=>1];
		$this->assign('infos',$infos);
		
		// $this->assign()
		return $this->fetch();
	}
	public function addinfos(){
		$data=input("post.");
		
		$data+=['adminid'=>1,
				'uid'=>0,
				'itime'=>date('Y-m-d H:i:s')];
		dump($data);
		$res=Db::name('information')->insert($data);
		if($res){
			$this->redirect('index');
		}else{
			$this->error('消息推送失败！');
		}
	}
}